/*
 * @Author: your name
 * @Date: 2021-02-15 19:45:41
 * @LastEditTime: 2021-02-23 18:22:29
 * @LastEditors: Please set LastEditors
 * @Description:添加工程
 * @FilePath: \jianfa-api\routes\admin\projectCode.js
 */

const express = require('express');
const router = express.Router();
const Result = require('../../models/result.js');
const { getProjectListService } = require('../../service/projectCodeService')


// 查询项目列表
router.post('/project_list', async (req, res, next) => {
 const { status, results } = await getProjectListService(req.body)
 if (status) {
  let data = { results, total: global.all_let.TOTAL }
  global.all_let.TOTAL != null ? null : delete data.total
  new Result(data, '查询成功').success(res)
 } else {
  new Result({}, '添加失败').fail(res)
 }
})


module.exports = router;